import request from '@/utils/request'

// api地址
const api = {
	tiku_list: 'dati.pk/tiku_list',
	game_info: 'dati.pk/game_info',
	getUserAnswer: 'dati.pk/get_game_tiku_detail',
	add: 'dati.pk/add',
	add_tiku: 'dati.pk/add_tiku',
	join: 'dati.pk/join',
	update_tiku: 'dati.pk/update_tiku',
	getResult: 'dati.pk/getResult',
}

export function getResult(id) {
	return request.get(api.getResult, {
		id
	})
}

export function tiku_list(param, option) {
	return request.get(api.tiku_list, param, option)
}
export function getUserAnswer(param, option) {
	return request.get(api.getUserAnswer, param, option)
}

export function game_info(param, option) {
	return request.get(api.game_info, param, option)
}
export const join = (data) => {
	return request.post(api.join, {
		form: data
	})
}
export const add_tiku = (data) => {
	return request.post(api.add_tiku, {
		form: data
	})
}
export const add = (data) => {
	return request.post(api.add, {
		form: data
	})
}
export const update_tiku = (data) => {
	return request.post(api.update_tiku, {
		form: data
	})
}